package com.ruoyi.model.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.model.domain.vo.ModelTaskProcessVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.ModelTaskProcessMapper;
import com.ruoyi.model.domain.ModelTaskProcess;
import com.ruoyi.model.service.IModelTaskProcessService;

/**
 * 任务处理Service业务层处理
 *
 * @author rww
 * @date 2024-11-25
 */
@Service
public class ModelTaskProcessServiceImpl implements IModelTaskProcessService
{
    @Autowired
    private ModelTaskProcessMapper modelTaskProcessMapper;

    /**
     * 查询任务处理
     *
     * @param id 任务处理主键
     * @return 任务处理
     */
    @Override
    public ModelTaskProcess selectModelTaskProcessById(Long id)
    {
        return modelTaskProcessMapper.selectModelTaskProcessById(id);
    }

    /**
     * 查询任务处理列表
     *
     * @param modelTaskProcess 任务处理
     * @return 任务处理
     */
    @Override
    public List<ModelTaskProcess> selectModelTaskProcessList(ModelTaskProcess modelTaskProcess)
    {
        return modelTaskProcessMapper.selectModelTaskProcessList(modelTaskProcess);
    }

    @Override
    public List<ModelTaskProcessVo> selectModelTaskProcessVoList(ModelTaskProcess taskProcess) {
        return modelTaskProcessMapper.selectModelTaskProcessVoList(taskProcess);
    }

    /**
     * 新增任务处理
     *
     * @param modelTaskProcess 任务处理
     * @return 结果
     */
    @Override
    public int insertModelTaskProcess(ModelTaskProcess modelTaskProcess)
    {
        modelTaskProcess.setId(IdUtil.getSnowflakeNextId());
        modelTaskProcess.setCreateTime(DateUtils.getNowDate());
        return modelTaskProcessMapper.insertModelTaskProcess(modelTaskProcess);
    }

    /**
     * 修改任务处理
     *
     * @param modelTaskProcess 任务处理
     * @return 结果
     */
    @Override
    public int updateModelTaskProcess(ModelTaskProcess modelTaskProcess)
    {
        modelTaskProcess.setUpdateTime(DateUtils.getNowDate());
        return modelTaskProcessMapper.updateModelTaskProcess(modelTaskProcess);
    }

    /**
     * 批量删除任务处理
     *
     * @param ids 需要删除的任务处理主键
     * @return 结果
     */
    @Override
    public int deleteModelTaskProcessByIds(Long[] ids)
    {
        return modelTaskProcessMapper.deleteModelTaskProcessByIds(ids);
    }

    /**
     * 删除任务处理信息
     *
     * @param id 任务处理主键
     * @return 结果
     */
    @Override
    public int deleteModelTaskProcessById(Long id)
    {
        return modelTaskProcessMapper.deleteModelTaskProcessById(id);
    }
}
